home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / IFF_Forms / SPLT.doc < prev    next >
Encoding:
Text File  |  1993-03-01  |  2.5 KB  |  74 lines

  1. ASDG's File SPLiTting system
  2.  
  3.  
  4. Here is the IFF SPLT Form.
  5. It is intended to provide a way to split big files into
  6. smaller pieces. I am developing program to read/write this
  7. format on a variety of platforms. Currently I have Amiga
  8. and MSDOS versions.
  9.  
  10. It could also be used to encapsulate binary files.
  11.  
  12. Also,  my  program  generates,  and  expects,  SPLT  file names of the form
  13. "name.001",  "name.002".  This oughta be part of the specification for this
  14. format, although such details are beyond the scope of IFF.
  15.  
  16.     FORMnnnnSPLT
  17.     Chunk types:
  18.         INFOnnnn    Information about the data file
  19.             total_size    Total size of original file **
  20.             count        Total number of chunks. **
  21.             position    Position this chunk was in original file
  22.                     This is defined bye:
  23.                      "Seek(file, position, OFFSET_BEGINNING)"
  24.             unit_number    Number of this chunk, from 0..(count-1)
  25.             secs        UNIX date format, seconds since Jan 1 1970
  26.                     AmigaDOS Seconds + 252482400 == UNIX Seconds.
  27.             bits        File mode bits...defined by AmigaDOS
  28.             compression    Compression type for the BODY chunk
  29.                     Compression types can be different for
  30.                     each BODY chunk.
  31.                     No compression types are defined yet.
  32.                 
  33.         EOF 0004
  34.             flag    either TRUE or FALSE.
  35.         CHKS0004
  36.             sum    The sum of the data in this chunk
  37.                 Sum the data chunk, a byte at
  38.                 a time. For example:
  39.  
  40.                     long sum = 0;
  41.                     UBYTE *p = buffer;
  42.                     
  43.                     for(i=0;i<length;i++) sum += *p++;
  44.  
  45.         TYPEnnnn
  46.             type    Mac filetype info. As yet this is
  47.                 not clearly defined. I will further define
  48.                 this when a Mac port is done. RSN
  49.         NAMEnnnn
  50.             chars    The original filename. Do not depend on NULL
  51.                 termination.
  52.         BODYnnnn
  53.             ..    The actual data for this chunk
  54.             
  55. The INFO chunk MUST appear before the BODY chunk.  Also, the NAME chunk has
  56. to  appear  before  the BODY chunk in the first file in order to be useful.
  57. The NAME chunk is not required.
  58.     
  59. The EOF chunk is not required except as noted below.
  60.  
  61. Note that the unit number in the INFO chunk start numbering things at
  62. zero, but my SPLT writer writes files with names starting at 001.
  63.  
  64. **  The  totalsize  and count fields may be zero.  If this is the case then
  65. the  file size and or chunk size could not be known ahead of time.  Readers
  66. of  this  FORM  should  expect this.  The last file in a sequence MUST then
  67. have  an  EOF chunk with contents of TRUE.  If a file has a true EOF chunk,
  68. then the data section MAY be missing.  If the last file (with total_size ==
  69. 0)  did  not contain an EOF, with flag TRUE, chunk then the end of the data
  70. file is missing.
  71.  
  72.  -- joe porkka, ASDG Inc.
  73.      (608) 273 6585
  74.